<?php
/**
 * 
 * dataList:[
			{
				title:"titlename1",
				status:'doing'
			},
			{
				title:"titlename2",
				status:'doing'
			},
			{
				title:"titlename3",
				status:'success'
			}
			]
 * */

//导入 配置信息
include("config.php");
class ReqDataType{
	public $status='error';
	public $type='getTitle';
	public $tableJson;
	public $msg;
}
class TableList{
	public $title;
	public $tag;
	public $code;
	public $type;
	public $datatime;
}


class ProcTableList{
	public $conn;
	public $userid;
	public $reqDataType;
	public $tableJson;
	function Init($conn,$userid){
		$this->conn=$conn;
		$this->userid=$userid;
		$this->tableJson=array();
	}
	function getTableList(){
		$conn=$this->conn;
		$sql="SELECT * FROM `tablelist` WHERE userid='$this->userid' ORDER BY `listid` DESC";
		$reqData=new ReqDataType();
		$result = $conn->query($sql);
		
		if($result->num_rows>0){
			
			while($row = $result->fetch_assoc()) {
				$tableList=new TableList();
				$tableList->title=$row['title'];
				$tableList->tag=$row['tag'];
				$tableList->code=$row['mask'];
				$tableList->type=$row['type'];
				$tableList->datatime=$row['datatime'];
				$this->tableJson[]=$tableList;
		    }
		    
			$reqData->status='success';
			$reqData->msg='get Titles success';
			$reqData->tableJson=$this->tableJson;
		}else{
			$reqData->status='error';
			$reqData->msg='get Titles error ';
			$reqData->tableJson='';
		}
		return $reqData;
	}
}


?>